package cn.circle.system.util;

import cn.circle.system.pagemodel.PageHelper;
public class HqlHelper {
	/**
	 * 增加排序的hql
	 * 
	 * @param ph
	 * @param params
	 * @return
	 */
	public static StringBuffer orderHql(StringBuffer hql, PageHelper ph) {
		if (ph.getSort() != null && ph.getOrder() != null) {
			hql.append(" order by t." + ph.getSort() + " " + ph.getOrder());
		}
		return hql;
	}

}
